package com.huirui.server.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.huirui.server.pojo.dto.ConfirmShipmentDto;
import com.huirui.server.pojo.dto.OrderCreateDto;
import com.huirui.server.pojo.dto.OrderPrepareInfoDTO;
import com.huirui.server.pojo.dto.OrderSubmitDto;
import com.huirui.server.pojo.entity.Order;
import com.huirui.server.pojo.result.PageResult;
import com.huirui.server.pojo.vo.*;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Min;
import org.springframework.validation.annotation.Validated;

import java.time.LocalDate;
import java.util.List;

/**
* @author yujun
* @description 针对表【t_order(订单表)】的数据库操作Service
* @createDate 2025-09-27 11:27:55
*/
public interface OrderService extends IService<Order> {

    List<OrderConfirmVo> listConfirmProductInfo(List<Long> ids);

    OrderResponseVo createOrder(OrderCreateDto orderCreateDto);

    List<OrderResponseVo> getAllOrderList(@Min(value = 1, message = "页码必须大于等于1") Long page, @Min(value = 1, message = "每页条数必须大于等于1") Long pageSize);

    List<OrderResponseVo> getPendingPaymentOrderList(@Min(value = 1, message = "页码必须大于等于1") Long page, @Min(value = 1, message = "每页条数必须大于等于1") Long pageSize);

    List<OrderResponseVo> getPendingReceiptOrderList(@Min(value = 1, message = "页码必须大于等于1") Long page, @Min(value = 1, message = "每页条数必须大于等于1") Long pageSize);

    List<OrderResponseVo> getFinishedOrderList(@Min(value = 1, message = "页码必须大于等于1") Long page, @Min(value = 1, message = "每页条数必须大于等于1") Long pageSize);

    List<OrderResponseVo> getAfterSalesOrderList(@Min(value = 1, message = "页码必须大于等于1") Long page, @Min(value = 1, message = "每页条数必须大于等于1") Long pageSize);

    List<OrderResponseVo> getPendingDeliveryOrderList(@Min(value = 1, message = "页码必须大于等于1") Long page, @Min(value = 1, message = "每页条数必须大于等于1") Long pageSize);

    void cancelOrder(Long orderId);

    void deleteOrder(Long orderId);

    OrderDetailVo getOrderDetail(Long orderId);

    void updateOrderDeliveryAddress(Long id, Long orderId);


    PageResult<OrderVo> listOrderVo(Integer orderType, Integer paymentMethod, Long status, LocalDate beginTime, LocalDate endTime, Integer searchCondition, String searchValue, @Min(value = 1, message = "页码不能小于1") Integer currentPage, @Min(value = 1, message = "每页条数不能小于1") Integer pageSize);

    OrderCountVo getBriefOrderCount();

    void editMerchantNote(Long orderId, String merchantNote);

    void editOrderPrice(Long orderId, String actualPayment);

    void closeOrder(Long orderId);

    HighlyDetailedOrderDetailVo getHighlyDetailedOrderDetails(Long orderId);

    void confirmShipment(@Valid ConfirmShipmentDto confirmShipmentDto);

    DeliveryInformationVo getDeliveryInformation(Long orderId);

    void confirmReceipt(Long orderId);

    void modifyDeliveryInformation(@Valid ConfirmShipmentDto confirmShipmentDto);

    OrderPrepareInfoVo getOrderPrepareInfo(OrderPrepareInfoDTO orderPrepareInfoDTO);

    OrderSubmitVo submitOrder(@Validated OrderSubmitDto orderSubmitDto);

}
